home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-01
/
tge120.zip
/
TGE.DOC
< prev
next >
Wrap
Text File
|
1993-05-05
|
74KB
|
1,682 lines
The Graphics Engine version 1.20 Documentation
May 5, 1993
The Graphics Engine software and manual are copyright (c) 1993
by Matthew Hildebrand. All rights reserved.
Topics covered in this document:
───────────────────────────────
INTRODUCTION
MAJOR FEATURES OF THE GRAPHICS ENGINE
SYSTEM REQUIREMENTS
PACKING LIST
RELEASE NOTES FOR VERSION 1.20
INCORPORATING THE GRAPHICS ENGINE
THE GRAPHICS ENGINE'S GRAPHICAL FUNCTION SET
VIEWPORTS AND CLIPPING
FONTS
USING THE MOUSE
THE GRAPHICS ENGINE'S MOUSE FUNCTION SET
WRITING GRAPHICS DRIVERS
TERMS OF USAGE AND DISTRIBUTION
CONTACTING THE AUTHOR
OBTAINING THE GRAPHICS ENGINE
REVISION HISTORY
ACKNOWLEDGEMENT
LEGAL MUMBO JUMBO
INTRODUCTION
────────────
The Graphics Engine is the result of my efforts to construct
a library of routines designed to make writing C/C++
graphics applications easier. I have used it in my own
programs with excellent results.
TGE allows the DOS programmer to easily access any graphics
mode, without having to do special coding for each; the
complications involved with supporting more than one
graphics mode are removed. TGE also provides remarkable
flexibility and expandability through its modular design.
MAJOR FEATURES OF THE GRAPHICS ENGINE
─────────────────────────────────────
TGE provides a simple, standard interface with which
programs may access a powerful library of graphical
functions. As an added bonus, this library occupies much
less memory than other commercial packages do, such as
Borland's BGI.
TGE supports device-independence using loadable drivers,
loadable fonts, viewports, interrupt-driven definable mouse
pointer services, a large number of mouse routines, and an
extensive graphical function set.
TGE's use of loadable graphics drivers means that all code
and data necessary to handle a certain graphics mode is
stored in a disk file. When a program runs, this file will
be loaded into memory and the code it contains will be made
available. Consequently:
- Support for more graphics modes may be added simply by
creating more drivers; programs need not be recompiled.
- Since the code to manage the specifics of each mode is
contained in the drivers, the main program needs not
concern itself with what mode it is operating in. The
same code can work in any graphics mode.
- Memory is saved for programs which support many
graphics modes. Instead of keeping the code and data
necessary for each in memory at all times, only the
memory required for one driver is used.
When writing drivers, it is not necessary to write assembly
code for every graphical function that TGE supports. For
instance, if a certain driver does not contain a line-
drawing routine, TGE will use its own. Therefore, the
programmer needs not waste time writing assembly code which
will seldom or never be used, thus slashing development
time. Essentially, no matter what a particular driver
contains, the entire set of TGE's graphical functions will
be available.
In addition to essential graphical functions, TGE also
includes interrupt-driven definable mouse pointer services,
as well as a large number of functions to interface with the
mouse driver.
The names of the graphical functions, such as "putImage" and
"filledRect" may easily be changed to suit individual
preferences.
It's powerful, fast, and cheap.
SYSTEM REQUIREMENTS
───────────────────
TGE is a C/C++ programmer's library. As such, it requires a
C or C++ compiler of some sort to work with it. TGE was
written and tested with Borland C++ 2.0 and Turbo C 2.0, and
also tested with Mix Power C 2.1.2. It should work with
other C/C++ compilers as well.
The drivers that come with TGE are written using 80286
instructions. They therefore cannot be used on a processor
older than the 286 unless they are modified first.
The loadable drivers are written in assembly language. In
order to write drivers, an assembler will be required.
The font code is C++, not C. In order to use loadable fonts,
a C++ compiler will be required.
PACKING LIST
────────────
The current version of TGE consists of the following files:
TGE.DOC TGE documentation
TGEDEMO.EXE TGE demo program
320X200.DRV Driver for VGA 320x200x256
320X240.DRV Driver for VGA 320x240x256
320X400.DRV Driver for VGA 320x400x256
360X480.DRV Driver for VGA 360x480x256
640X480.DRV Driver for SuperVGA/VESA 640x480x256
800X600.DRV Driver for SuperVGA/VESA 800x600x256
1024X768.DRV Driver for SuperVGA/VESA 1024x768x256
8X8.FNT 8x8 font definition file
8X14.FNT 8x14 font definition file
8X16.FNT 8x16 font definition file
PCX2RAW.ARJ Image format translation utility and its
source code
PCX2RAW.EXE Executable version
PCX2RAW.CPP Source for above
PCX.CPP PCX routines
TYPES.H Some handy typedefs
SOURCE.ARJ Full source code
TGE.H TGE header file
TGE.C Main C file
CLIP.C Supplementary clipping routines
TGEFONT.H Header file for TGE fonts
TGEFONT.CPP TGE font support (C++ only)
TGEMOUSE.H Mouse header file
TGEMOUSE.ASM Various mouse routines
MOUSEPTR.C Definable mouse pointer support
NEWMOUSE.ASM More definable pointer support
TGEDEMO.CPP Source for TGEDEMO.EXE
320X200.ASM 320x200x256 source
320X240.ASM 320x240x256 source
320X400.ASM 320x400x256 source
360X480.ASM 360x480x256 source
640X480.ASM 640x480x256 source
800X600.ASM 800x600x256 source
1024X768.ASM 1024x768x256 source
SHELL.ASM Skeleton driver source; use this file as
a basis in making custom drivers
CDRV.BAT Create a .DRV from .ASM
REGISTER.FRM Registration form
If you did not receive all of these files, you have an
illegal copy of The Graphics Engine.
RELEASE NOTES FOR VERSION 1.20
──────────────────────────────
TGE now supports loadable fonts, viewports, region fills,
and colour approximation.
The loadGraphDriver() routine has been rewritten to provide
for more descriptive return values. If this version of TGE
is to be used in a program built with a previous version, a
slight change to the code will be necessary when checking
whether or not loadGraphDriver() succeeded; see
INCORPORATING THE GRAPHICS ENGINE for details. Similarly,
the syntax for initNewMouse() has changed; it now has no
parameters. Other parts of the code have been touched up in
less important ways.
This version fixes the Trident 8900 800x600 bug in release
1.10.
TGE has not been tested with any compilers other than
Borland C++ 2.0, Turbo C 2.0, and Mix Power C 2.1.2.
Although provisions have been made in the code which aid
portability, it may not work with other compilers in spite
of these efforts.
The loadable drivers used with this release are not
compatible with the drivers from version 1.10 or older, due
to changes in the drivers.
INCORPORATING THE GRAPHICS ENGINE
─────────────────────────────────
Incorporating TGE into a program is an easy process
involving four simple steps.
First, the header file TGE.H must be #included into any
source file which accesses any of TGE's routines. TGE.C
must be compiled and linked into the .EXE file.
Second, a graphics driver MUST be loaded before any
graphical functions are accessed; results are undefined if
this step is not followed. Code to load a driver might look
like this:
if (loadGraphDriver(drvFileName) != TGE_SUCCESS)
{
printf("Error loading \"%s\".\n\n", drvFileName);
exit(1);
}
else
atexit(unloadGraphDriver);
Obviously, the function loadGraphDriver() MUST be called.
As its only parameter, it takes a string consisting of the
file name (which may include any valid DOS path) of the
driver to be loaded. It returns a success code:
TGE_SUCCESS if the loading was successful, or one of
TGE_OPEN_ERR (file not found), TGE_FORMAT_ERR (file is not a
TGE driver), TGE_ALLOC_ERR (out of memory), and TGE_FILE_ERR
(general file I/O error) if an error occurred. These macros
are defined in TGE.H.
Third, information about the graphics mode should be
obtained from the graphics driver. The following code will
store the maximum X-coordinate, Y-coordinate, and colour
number in the variables maxx, maxy, and colours
respectively:
maxx = MAXX; // set up variables
maxy = MAXY;
maxColour = MAXCOLOUR;
This step is not necessary, but helps improve speed. (MAXX,
MAXY, and MAXCOLOUR are macros which expand to references of
a structure via a pointer; global variables are much
faster.)
Fourth, after TGE's graphical functions are no longer needed
(usually just before a program exit), the function
unloadGraphDriver() should be called. It takes no
parameters, and returns nothing. It simply frees the memory
taken up by a driver after it has been loaded. (With some
compilers it is not necessary to call this function, but
it's safer to call it just to be sure.) It is often a good
idea to place unloadGraphDriver() in the atexit() queue.
Note that the initGraphics() function must be called to
enter graphics mode; for more information, see the next
section.
Information on incorporating TGE's mouse routines may be
found in the section entitled USING THE MOUSE.
THE GRAPHICS ENGINE'S GRAPHICAL FUNCTION SET
────────────────────────────────────────────
After a driver has been loaded, all of TGE's graphical
functions can be accessed. To call a function, simply
execute
functionName(parameter list);
where "functionName" is the name of the desired function
(eg. "line" or "filledRect") and "parameter list" is all
parameters to that function, if any.
A complete list of TGE's graphical functions follows.
*** Function: initGraphics()
Syntax: void huge initGraphics(void);
Purpose: Initialize graphics mode.
Parameters: None.
Return value: 1 on success or 0 on error.
Remarks: On any call other than its first,
initGraphics will also restore the colour
palette which was active at the time
deInitGraphics() was last called.
See also: deInitGraphics()
*** Function: deInitGraphics()
Syntax: void deInitGraphics(void);
Purpose: Revert to 80x25 colour text mode.
Parameters: None.
Return value: None.
Remarks: deInitGraphics will keep a copy of the active
colour palette before shutting off graphics.
This palette will be restored by any future
call to initGraphics().
See also: initGraphics()
*** Function: putImage()
Syntax: void huge putImage(int x, int y, void far
*image);
Purpose: Place a bitmap, or image, onto the screen.
Parameters: The bitmap contained in 'image' will be
placed onto the screen with its upper-left
coordinate at ('x','y').
Return value: None.
Remarks: Clipping is performed; the image may be
placed entirely on-screen, partially on-
screen, or entirely off-screen.
This function is declared as huge so
that it will work properly when called from
within an interrupt service routine.
See also: putImageInv(), getImage(), imageSize(),
putLine(), getLine()
*** Function: putImageInv()
Syntax: void huge putImageInv(int x, int y, void far
*image);
Purpose: Place a bitmap, or image, on the screen.
Parameters: The bitmap contained in 'image' will be
placed onto the screen with its upper-left
coordinate at ('x','y').
Return value: None.
Remarks: Clipping is performed; the image may be
placed entirely on-screen, partially on-
screen, or entirely off-screen.
putImageInv() differs from putImage() only in
that it allows for transparent, or invisible,
colours. If any pixel in the image buffer
has a value of zero, the corresponding pixel
on-screen will not be modified. Using
putImageInv() can avoid having black borders
around non-rectangular shapes.
This function is declared as huge so
that it will work properly when called from
within an interrupt service routine.
See also: putImage(), getImage(), imageSize(),
putLine(), getLine()
*** Function: getImage()
Syntax: void huge getImage(int ulx, int uly, int lrx,
int lry, void far *image);
Purpose: Copy the specified rectangular portion of the
screen to memory.
Parameters: The portion of the screen with its upper-left
coordinate at ('ulx','uly') and its lower-
left coordinate at ('lrx','lry') will be
copied into the previously allocated memory
region at 'image' (see imageSize()).
Return value: None.
Remarks: Clipping is performed. Note that only
the portion of the specified region which
lies within the current viewport will be
placed in the image buffer by getImage(). Be
careful not to assume that a getImage() image
has off-screen data in it.
This function is declared as huge so
that it will work properly when called from
within an interrupt service routine.
See also: putImage(), putImageInv(), imageSize(),
putLine(), getLine()
*** Function: imageSize()
Syntax: unsigned long imageSize(int ulx, int uly, int
lrx, int lry);
Purpose: Determine the amount of memory required to
hold a rectangular portion of the screen.
Parameters: imageSize() will calculate the amount of
memory required to hold the porion of the
screen whose upper-left coordinate is
('ulx','uly') and whose lower-left coordinate
is ('lrx','lry').
Return value: imageSize returns an unsigned long containing
the size of the area in bytes.
Remarks: Clipping is performed.
imageSize() is designed for use with
putImage(), putImageInv(), and getImage().
To use it with putLine() and getLine(),
subtract 4 from the value it returns. (Image
buffers have four bytes of dimension
information in them; line buffers do not.)
See also: putImage(), putImageInv(), getImage(),
putLine(), getLine()
*** Function: putLine()
Syntax: void putLine(int lineNum, int xOff, int
lineLen, void far *buf);
Purpose: Place one horizontal line of image data on
the screen.
Parameters: The one-line bitmap contained in 'buf', of
'lineLen' pixels, will be placed on-screen
starting at ('xOff','lineNum').
Return value: None.
Remarks: No clipping is performed. Results are
undefined if any coordinate on the line is
off-screen.
See also: getLine(), putImage(), putImageInv(),
getImage()
*** Function: getLine()
Syntax: void getLine(int lineNum, int xOff, int
lineLen, void far *buf);
Purpose: Copy one horizontal line from the screen to
memory.
Parameters: The horizontal line whose left coordinate is
('xOff','lineNum') and whose length is
'lineLen' pixels will be copied into the
previously allocated memory region at 'buf'.
Return value: None.
Remarks: No clipping is performed. Results are
undefined if any coordinate on the line is
off-screen.
See also: putLine(), putImage(), putImageInv(),
getImage()
*** Function: putPixel()
Syntax: void putPixel(int x, int y, unsigned colour);
Purpose: Place a single pixel on-screen.
Parameters: The pixel located at ('x','y') will be set to
the colour 'colour'.
Return value: None.
Remarks: Clipping is not performed; see clipPoint()
and pointOnScreen() for details on clipping
pixels.
See also: getPixel()
*** Function: getPixel()
Syntax: unsigned getPixel(int x, int y);
Purpose: Return the value of a pixel.
Parameters: The value of the pixel at ('x','y') is
returned.
Return value: The value of the pixel at (x,y) is returned.
Remarks: Clipping is not performed; see clipPoint()
and pointOnScreen() for details on clipping
pixels.
See also: putPixel()
*** Function: line()
Syntax: void line(int x1, int y1, int x2, int y2,
unsigned colour);
Purpose: Draw a line between two points.
Parameters: The line will be drawn joining ('x1','y1')
and ('x2','y2') in the colour 'colour'.
Return value: None.
Remarks: Clipping is not performed; see clipLine() for
details on clipping lines.
See also: horizLine()
*** Function: horizLine()
Syntax: void horizLine(int y, int x1, int x2,
unsigned colour);
Purpose: Draw a horizontal line between two points.
Parameters: The line will be drawn between ('x1','y') and
('x2','y') in the colour contained in colour.
Return value: None.
Remarks: Clipping is not performed.
See also: line()
*** Function: drawRect()
Syntax: void drawRect(int ulx, int uly, int lrx, int
lry, unsigned colour);
Purpose: Draw a rectangle.
Parameters: The rectangle will be drawn with its upper-
left coordinates at ('ulx','uly') and its
lower-left coordinates at ('lrx','lry'), in
the colour 'colour'.
Return value: None.
Remarks: Clipping is performed.
See also: filledRect()
*** Function: filledRect()
Syntax: void filledRect(int ulx, int uly, int lrx,
int lry, unsigned colour);
Purpose: Draw a filled rectangle.
Parameters: The rectangle will be drawn with its upper-
left coordinates at ('ulx','uly') and its
lower-left coordinates at ('lrx','lry'), in
the colour 'colour'.
Return value: None.
Remarks: Clipping is not performed; see
clipFilledRect() for details on clipping
filledRects.
See also: drawRect()
*** Function: setPaletteReg()
Syntax: void setPaletteReg(unsigned palReg, unsigned
char red, unsigned char green, unsigned char
blue);
Purpose: Set a palette register.
Parameters: The red, green, and blue components of the
palette register palReg will be set to 'red',
'green', and 'blue' respectively.
Return value: None.
Remarks: Each of the colour components ('red',
'green', 'blue') should be in the range
0..255, not 0..63 as would be the case using
a stock VGA. The drivers will take care of
converting 8-bit to 6-bit palette resolution
if necessary.
See also: getPaletteReg(), setBlockPalette(),
getBlockPalette()
*** Function: getPaletteReg()
Syntax: void getPaletteReg(unsigned palReg, unsigned
char far *red, unsigned char far *green,
unsigned char far *blue);
Purpose: Return the current settings of a palette
register.
Parameters: The red, green, and blue contents of the
palette register palReg will be stored in
'red', 'green', and 'blue' respectively.
Return value: The red, green, and blue components of the
palette register are returned in 'red',
'green', and 'blue'.
Remarks: Each of the colour components ('red',
'green', 'blue') are in the range 0..255, not
0..63 as would be the case using a stock VGA.
The drivers will take care of converting 8-
bit to 6-bit palette resolution if necessary.
See also: setPaletteReg(), setBlockPalette(),
getBlockPalette()
*** Function: setBlockPalette()
Syntax: void setBlockPalette(unsigned firstReg,
unsigned numRegs, void far *data);
Purpose: Set a block of palette registers.
Parameters: 'numRegs' palette registers, starting at
'firstReg', will be set to the values
contained in 'data'.
Return value: None.
Remarks: The memory region at 'data' is organised
in groups of three bytes; each group
corresponds to one palette register, and each
group is made up of, in order, the red,
green, and blue components. The first group
is for the first register, the second for the
second, and so on.
Each of the colour components (red,
green, blue) should be in the range 0..255,
not 0..63 as would be the case using a stock
VGA. The drivers will take care of
converting 8-bit to 6-bit palette resolution
if necessary.
See also: getBlockPalette(), setPaletteReg(),
getPaletteReg()
*** Function: getBlockPalette()
Syntax: void getBlockPalette(unsigned firstReg,
unsigned numRegs, void far *data);
Purpose: Get the values of a block of palette
registers.
Parameters: The values of 'numRegs' palette registers,
starting at 'firstReg', will be stored in the
previously allocated 'data'.
Return value: The values are returned in 'data'.
Remarks: The memory region at 'data' is organised
in groups of three bytes; each group
corresponds to one palette register, and each
group is made up of, in order, the red,
green, and blue components. The first group
is for the first register, the second for the
second, and so on.
Each of the colour components (red,
green, blue) is in the range 0..255, not
0..63 as would be the case using a stock VGA.
The drivers will take care of converting 8-
bit to 6-bit palette resolution if necessary.
See also: setBlockPalette(), setPaletteReg(),
getPaletteReg()
*** Function: clearGraphics()
Syntax: void clearGraphics(unsigned colour);
Purpose: Clear the screen.
Parameters: The screen will be cleared to the colour
'colour'.
Return value: None.
Remarks: This function clears the entire screen, not
just the current viewport.
See also: filledRect()
*** Function: ellipse()
Syntax: void ellipse(int x, int y, int wide, int
deep, unsigned colour);
Purpose: Draw the outline of an ellipse.
Parameters: An ellipse centered at ('x','y') and having
width 'wide' and depth 'deep' will be drawn
in the colour 'colour'.
Return value: None.
Remarks: Clipping is performed.
See also: filledEllipse(), circle(), filledCircle()
*** Function: filledEllipse()
Syntax: void filledEllipse(x, int y, int wide, int
deep, unsigned colour);
Purpose: Draw a filled ellipse.
Parameters: An ellipse centered at ('x','y') and having
width 'wide' and depth 'deep' will be drawn
in the colour 'colour'.
Return value: None.
Remarks: Clipping is performed.
See also: ellipse(), filledCircle(), circle()
*** Function: circle()
Syntax: void circle(int x, int y, int radius,
unsigned colour);
Purpose: Draw the outline of a circle.
Parameters: A circle centered at ('x','y') and having
radius 'radius' will be drawn in the colour
'colour'.
Return value: None.
Remarks: Clipping is performed.
The 'radius' parameter is the radius in
pixels measured horizontally. Although there
will be no difference in modes with square
pixels, it will make a difference in other
modes; to ensure accurate drawing of the
circle with the given radius, make certain
that the radius is measured horizontally.
TGE uses an all-integer approach to
coordinate scaling to ensure that the drawn
shape will be circular in modes without
square pixels.
See also: filledCircle(), filledEllipse(), ellipse()
*** Function: filledCircle()
Syntax: void filledCircle(int x, int y, int radius,
unsigned colour);
Purpose: Draw a filled circle.
Parameters: A circle centered at ('x','y') and having
radius 'radius' will be drawn in the colour
'colour'.
Return value: None.
Remarks: Clipping is performed.
The 'radius' parameter is the radius in
pixels measured horizontally. Although there
will be no difference in modes with square
pixels, it will make a difference in other
modes; to ensure accurate drawing of the
circle with the given radius, make certain
that the radius is measured horizontally.
TGE uses an all-integer approach to
coordinate scaling to ensure that the drawn
shape will be circular in modes without
square pixels.
See also: circle(), ellipse(), filledEllipse()
*** Function: fillRegion()
Syntax: void fillRegion(int x, int y, unsigned
colour);
Purpose: Floods a region of the screen with the
specified colour.
Parameters: The fill will begin at the seed point
('x','y'), and will fill with the colour
'colour'.
Return value: None.
Remarks: The region to be filled is bounded by
any colour not equal to the colour at
('x','y'); ie., the region to be filled
consists of one colour only.
Clipping is performed.
See also: None.
*** Function: colourCloseTo()
Syntax: unsigned colourCloseTo(unsigned char red,
unsigned char green, unsigned char blue);
Purpose: Given a 24-bit colour, find the colour from
the current palette which most closely
matches it.
Parameters: The 24-bit colour is defined by the 'red',
'green', and 'blue' parameters.
Return value: Returns the colour which most closely matches
the specified 24-bit colour.
Remarks: None.
See also: colourCloseToX()
*** Function: colourCloseToX()
Syntax: unsigned colourCloseToX(unsigned char red,
unsigned char green, unsigned char blue,
unsigned colourExclude);
Purpose: Given a 24-bit colour, find the colour from
the current palette which most closely
matches it, with the specified colour
disallowed from the search.
Parameters: The 24-bit colour is defined by the 'red',
'green', and 'blue' parameters. The colour
'colourExclude' is excluded from the search,
and so will never be returned.
Return value: Returns the colour which most closely matches
the specified 24-bit colour.
Remarks: Excluding zero from a search will ensure that
the returned colour will be visible when it
is used as part of a bitmap displayed using
putImageInv().
See also: colourCloseTo()
Note that since these function names are actually macros,
they may easily be changed to suit individual preferences by
editing TGE.H.
VIEWPORTS AND CLIPPING
──────────────────────
A viewport is a rectangular region on the screen to which
output is clipped. By default, this region is the entire
screen; however, it can be set to any portion of the screen.
(Note that when a viewport is in use, coordinates are
absolute, not relative to the viewport.)
The following functions are used to get and set the current
viewport:
*** Function: setViewport()
Syntax: void setViewport(int ulx, int uly, int lrx,
int lry);
Purpose: Set the defining coordinates of the current
viewport.
Parameters: The upper-left corner of the viewport will be
set to ('ulx','uly'), and the lower-right
corner to ('lrx','lry').
Return value: None.
Remarks: It is assumed that 'ulx'<'lrx' and that
'uly'<'lry'.
See also: getViewport()
*** Function: getViewport()
Syntax: void getViewport(int far *ulx, int far *uly,
int far *lrx, int far *lry);
Purpose: Get the defining coordinates of the current
viewport.
Parameters: The upper-left corner of the viewport will be
returned in ('ulx','uly'), and the lower-
right corner in ('lrx','lry').
Return value: None.
Remarks: None.
See also: setViewport()
Note, however, that not all of TGE's functions will clip to
within the current viewport. Some of the time-critical
graphics primitives, such as putPixel() and line(), do not
clip in order to improve execution time. If it is necessary
for such functions to have their output clipped, the
following routines may be used:
*** Function: clipFilledRect()
Syntax: int clipFilledRect(int *x1, int *y1, int *x2,
int *y2);
Purpose: Clip the given filled rectangle to within the
current viewport.
Parameters: The upper-left and lower-right corners of the
rectangle are passed in ('x1','y1') and
('x2','y2'). If clipping is done, these
points will be modified.
Return value: Returns true if the rectangle lies entirely
or partially within the current viewport, or
false if it is entirely outside the current
viewport.
Remarks: It does not matter which of the corner
coordinates is passed first; they will be
swapped if necessary.
This function is contained in CLIP.C.
*** Function: clipLine()
Syntax: int clipLine(int *x1, int *y1, int *x2, int
*y2);
Purpose: Clip the given line to within the current
viewport.
Parameters: The endpoints of the line are passed in
('x1','y1') and ('x2','y2'). If clipping is
done, these endpoints will be modified.
Return value: Returns true if the line lies entirely or
partially within the current viewport, or
false if it is entirely outside the current
viewport.
Remarks: This function is contained in CLIP.C.
See also: None.
*** Function: clipPoint()
Syntax: int clipPoint(int x, int y);
Purpose: Return a flag indicating whether or not the
specified coordinates lie within the current
viewport.
Parameters: The point ('x','y') is tested.
Return value: Returns true if ('x','y') is within the
current viewport, or 0 if it isn't.
Remarks: This function is really a macro defined in
TGE.H.
See also: None.
*** Function: pointOnScreen()
Syntax: int pointOnScreen(int x, int y);
Purpose: Return a flag indicating whether or not the
specified coordinates lie on-screen.
Parameters: The point ('x','y') is tested.
Return value: Returns true if ('x','y') is on-screen, or 0
if it is off-screen.
Remarks: This function is really a macro defined in
TGE.H.
See also: None.
Note that since these function names are actually macros,
they may easily be changed to suit individual preferences by
editing TGE.H.
FONTS
─────
TGE supports loadable fonts, implemented in C++ using the
"Font" class. At present, TGE's fonts are composed of
monochrome bitmaps of a single size, using one bitmap for
each character. Both high- and low-ASCII characters are
supported. As well, multiple fonts may be resident in
memory simultaneously.
In order to use a font, an instance of the Font class is
necessary. Assuming instantiation of a Font pointer, font
initialization will look something like this:
Font *systemFont;
char systemFontName[] = "8x16.fnt";
.
.
.
systemFont = new Font(systemFontName); // load font
if (!systemFont || !systemFont->status())
{
printf("Error loading %s\n\n", systemFontName);
exit(1);
}
Once a font has been loaded, it may be manipulated via its
Font class instance. A complete list of the Font member
functions follows.
*** Function: Font::Font()
Syntax: Font::Font(char *filename, unsigned char
fg=1, unsigned char bg=0);
Purpose: Load a font, and initiate a Font class for
use with it.
Parameters: 'filename' is the name of the font data file.
'fg' (optional) is the colour to be used as
the foreground colour. 'bg' (optional) is
the colour to be used as the background
colour.
Return value: None.
Remarks: After an instantiation of a Font, ensure that
the loading and initialization was successful
using the method illustrated above.
See also: Font::~Font()
*** Function: Font::~Font()
Syntax: Font::~Font()
Purpose: Free the memory used by a font, and perform
any other clean-up actions when a Font is no
longer needed.
Parameters: None.
Return value: None.
Remarks: None.
See also: Font::Font()
*** Function: Font::status()
Syntax: inline int Font::status(void);
Purpose: Return a flag indicating whether or not the
font loading and initialization were
successful.
Parameters: None.
Return value: Returns 1 if the initialization was
successful, or 0 if it wasn't.
Remarks: None.
See also: None.
*** Function: Font::wide(char*)
Syntax: unsigned Font::wide(char *str);
Purpose: Return the width, in pixels, of a string.
Parameters: The string 'str' is analyzed.
Return value: Returns the width of 'str', in pixels.
Remarks: None.
See also: Font::wide(char), Font::deep(char*),
Font::deep(char), Font::maxWide(),
Font::maxDeep()
*** Function: Font::wide(char)
Syntax: inline unsigned Font::wide(char ch);
Purpose: Return the width, in pixels, of a single
character.
Parameters: The character 'ch' is analyzed.
Return value: Returns the width of 'ch', in pixels.
Remarks: None.
See also: Font::wide(char*), Font::deep(char),
Font::deep(char*), Font::maxWide(),
Font::maxDeep()
*** Function: Font::maxWide(void)
Syntax: inline unsigned maxWide(void);
Purpose: Return the width of the widest character.
Parameters: None.
Return value: Returns the width of the widest character.
Remarks: None.
See also: Font::maxDeep(void), Font::wide(char*),
Font::wide(char), Font::deep(char*),
Font::deep(char)
*** Function: Font::deep(char*)
Syntax: unsigned Font::deep(char *str);
Purpose: Return the depth, in pixels, of a string.
Parameters: The string 'str' is analyzed.
Return value: Returns the depth of 'str', in pixels.
Remarks: None.
See also: Font::deep(char), Font::wide(char*),
Font::deep(char), Font::maxDeep(),
Font::maxWide()
*** Function: Font::deep(char)
Syntax: unsigned Font::deep(char ch);
Purpose: Return the depth, in pixels, of a single
character.
Parameters: The character 'ch' is analyzed.
Return value: Returns the depth of 'ch', in pixels.
Remarks: None.
See also: Font::deep(char*), Font::wide(char),
Font::wide(char*), Font::maxWide(),
Font::maxDeep()
*** Function: Font::maxDeep(void)
Syntax: inline unsigned maxDeep(void);
Purpose: Return the depth of the deepest character.
Parameters: None.
Return value: Returns the depth of the deepest character.
Remarks: None.
See also: Font::maxWide(void), Font::deep(char*),
Font::deep(char), Font::wide(char*),
Font::wide(char)
*** Function: Font::put(int, int, char*)
Syntax: void Font::put(int x, int y, char *str);
Purpose: Write a string to the screen.
Parameters: The string 'str' will be written starting at
('x','y').
Return value: None.
Remarks: The coordinate passed to this function
specifies the upper-left coordinate of the
string.
See also: Font::put(char);
*** Function: Font::put(int, int, char)
Syntax: void Font::put(int x, int y, char ch);
Purpose: Write a single character to the screen.
Parameters: The character 'ch' will be written at
('x','y').
Return value: None.
Remarks: The coordinate passed to this function
specifies the upper-left coordinate of the
character.
See also: Font::put(char*);
*** Function: Font::foreground(unsigned)
Syntax: inline void Font::foreground(unsigned
colour);
Purpose: Set the current foreground colour.
Parameters: The foreground colour will be set to
'colour'.
Return value: None.
Remarks: None.
See also: Font::background(unsigned),
Font::foreground(void),
Font::background(void)
*** Function: Font::foreground(void)
Syntax: inline unsigned Font::foreground(void);
Purpose: Return the current foreground colour.
Parameters: None.
Return value: Returns the current foreground colour.
Remarks: None.
See also: Font::background(void),
Font::foreground(unsigned),
Font::foreground(unsigned)
*** Function: Font::background(unsigned)
Syntax: inline void Font::background(unsigned
colour);
Purpose: Set the current background colour.
Parameters: The background colour will be set to
'colour'.
Return value: None.
Remarks: None.
See also: Font::foreground(unsigned),
Font::background(void),
Font::foreground(void)
*** Function: Font::background(void)
Syntax: inline unsigned Font::background(void);
Purpose: Return the current background colour.
Parameters: None.
Return value: Returns the current background colour.
Remarks: None.
See also: Font::foreground(void),
Font::background(unsigned),
Font::foreground(unsigned)
Note that, at present, TGE's fonts are designed for use in
256-colour modes only.
USING THE MOUSE
───────────────
TGE now provides support for interrupt-driven, definable
mouse pointers. In order to make use of this feature, some
simple steps must be taken.
First, please be aware that the file MOUSEPTR.C is currently
designed specifically for 256-colour modes. This file is
the one that creates the pointer bitmaps and passes them to
the mouse driver; some modifications may be necessary in
order for it to work in modes with other than 256 colours.
The new mouse handler is designed to work in tandem with
TGE's graphical functions. Programs using the new mouse
handler must first have successfully initialized graphics
mode using TGE. Both TGE.H and TGEMOUSE.H must be #included
into a program using the mouse services.
The mouse handler has to be initialized. To do so, one
function call is required:
initNewMouse();
For more information on initNewMouse(), refer to the mouse
functions reference section.
Next, the mouse driver must be informed of the screen
dimensions, like this:
setHorizLimitsMouse(0, maxx);
setVertLimitsMouse(0, maxy);
If desired, the pointer may then be positioned. To center
it on the screen, do this:
setPosMouse((maxx+1)/2, (maxy+1)/2);
A pointer shape must then be selected. TGE, as shipped,
includes an arrow pointer and a target pointer; the file
MOUSEPTR.C may easily be modified to allow more. To select,
for instance, the target pointer, do this:
setupMousePointer(TARGET_POINTER);
The macro TARGET_POINTER is defined in TGEMOUSE.H; it
expands to a number which is used by MOUSEPTR.C to identify
which bitmap to use. Note that if exceptionally large (ie.
larger than 1 K) pointers are used, a change must be made in
NEWMOUSE.ASM; see that file for details.
Once things have been initialized, the use of the new mouse
handler over the default driver can essentially be ignored;
mouse driver services are obtained in exactly the same way.
The file TGEMOUSE.ASM contains functions to interface to
most of the mouse driver's services; they are prototyped in
TGEMOUSE.H, also using the macro method which allows
function names to be changed simply by editing TGEMOUSE.H.
Before exiting the program, the function deInitNewMouse()
_must_ be called. It is often a good idea to place
deInitNewMouse() in the atexit() queue.
Note that, since the pointer is drawn using TGE's
putImageInv() function, the pointer will only appear when it
is within the current viewport.
THE GRAPHICS ENGINE'S MOUSE FUNCTION SET
────────────────────────────────────────
*** Function: initNewMouse()
Purpose: Initializes the new mouse handler.
Parameters: The new mouse handler will be configured for
use with TGE.
Return value: None.
Remarks: A graphics driver must have been loaded
prior to a call to initNewMouse().
The new mouse handler requires that a
Microsoft or compatible mouse driver already
be resident. It assumes that a mouse
driver's presence will have been tested
beforehand.
initNewMouse() is really a simple macro;
refer to TGEMOUSE.H for the expansion.
See also: deInitNewMouse(), enableNewMouse(),
disableNewMouse(), resetMouse()
*** Function: deInitNewMouse()
Syntax: void deInitNewMouse(void);
Purpose: Deactivate the new mouse handler, and leave
all the work up to the old driver.
Parameters: None.
Return value: None.
Remarks: This function _must_ be called prior to
program exit if initNewMouse() had previously
been called.
See also: initNewMouse(), enableNewMouse(),
disableNewMouse()
*** Function: enableNewMouse()
Syntax: void enableNewMouse(void);
Purpose: Reactivate the new mouse handler following a
call to disableNewMouse().
Parameters: None.
Return value: None.
Remarks: None.
See also: disableNewMouse(), initNewMouse(),
deInitNewMouse()
*** Function: disableNewMouse()
Syntax: void disableNewMouse(void);
Purpose: Temporarily deactivate the new mouse handler,
to be reactivated later by a call to
enableNewMouse().
Parameters: None.
Return value: None.
Remarks: Following a call to this function, the new
mouse handler will cease trapping mouse
driver interrupts and moving the pointer.
See also: enableNewMouse(), initNewMouse(),
deInitNewMouse()
*** Function: resetMouse()
Syntax: int resetMouse(void);
Purpose: Reset the mouse driver and hardware.
Parameters: None.
Return value: 1 if mouse driver available, 0 otherwise.
Remarks: Following a call to this function, the mouse
pointer is hidden and positioned at the
center of the screen.
See also: softResetMouse(), initNewMouse()
*** Function: getButtonsMouse()
Syntax: int getButtonsMouse(void);
Purpose: Return the number of buttons on the mouse.
Parameters: None.
Return value: Returns the number of buttons on the mouse.
Remarks: This function calls resetMouse(), and so the
mouse driver and hardware are re-initialized.
See also: resetMouse()
*** Function: showMouse()
Syntax: void showMouse(void);
Purpose: Show the mouse pointer.
Parameters: None.
Return value: None.
Remarks: Calls to showMouse() and hideMouse() are
cumulative; ie., if showMouse() is called
twice, hideMouse() must be called twice to
hide the pointer again.
See also: hideMouse()
*** Function: hideMouse()
Syntax: void hideMouse(void);
Purpose: Hide the mouse pointer.
Parameters: None.
Return value: None.
Remarks: Calls to showMouse() and hideMouse() are
cumulative; ie., if showMouse() is called
twice, hideMouse() must be called twice to
hide the pointer again.
See also: showMouse()
*** Function: getPosMouse()
Syntax: void getPosMouse(int far *x, int far *y);
Purpose: Get the current pointer coordinates.
Parameters: The current pointer x- and y-coordinates will
be stored in 'x' and 'y', respectively.
Return value: None.
Remarks: None.
See also: setPosMouse()
*** Function: setPosMouse()
Syntax: void setPosMouse(unsigned x, unsigned y);
Purpose: Set the current pointer coordinates.
Parameters: The pointer will be positioned at ('x','y').
Return value: None.
Remarks: None.
See also: getPosMouse()
*** Function: buttonMouse()
Syntax: int buttonMouse(void);
Purpose: Return whether or not any of the mouse
buttons is down.
Parameters: None.
Return value: Returns true if at least one button is down,
or zero if none of them is down.
Remarks: None.
See also: leftButtonMouse(), rightButtonMouse(),
centerButtonMouse(), waitReleaseMouse()
*** Function: leftButtonMouse()
Syntax: int leftButtonMouse(void);
Purpose: Return the status of the left mouse button.
Parameters: None.
Return value: Returns true if the button is down, or zero
if it is up.
Remarks: None.
See also: buttonMouse(), rightButtonMouse(),
centerButtonMouse(), waitReleaseMouse()
*** Function: rightButtonMouse()
Syntax: int rightButtonMouse(void);
Purpose: Return the status of the right mouse button.
Parameters: None.
Return value: Returns true if the button is down, or zero
if it is up.
Remarks: None.
See also: buttonMouse(), leftButtonMouse(),
centerButtonMouse(), waitReleaseMouse()
*** Function: centerButtonMouse()
Syntax: int centerButtonMouse(void);
Purpose: Return the status of the center mouse button.
Parameters: None.
Return value: Returns true if the button is down, or zero
if it is up.
Remarks: None.
See also: buttonMouse(), leftButtonMouse(),
rightButtonMouse(), waitReleaseMouse()
*** Function: buttonPressMouse()
Syntax: unsigned buttonPressMouse(unsigned button,
int far *x, int far *y);
Purpose: Return the number of times the specified
button has been pressed since the last call
to this function (with the same button
parameter), and store the coordinates of the
last press.
Parameters: The button 'button' is checked, and may be
any of LEFTBUTTON, RIGHTBUTTON, and
CENTERBUTTON, which are defined in
TGEMOUSE.H. The position of the last press
will be stored in ('x','y').
Return value: Returns the number of times the specified
button has been pressed since the last call
to this function (with the same button
parameter).
Remarks: None.
See also: buttonReleaseMouse()
*** Function: buttonReleaseMouse()
Syntax: unsigned buttonReleaseMouse(unsigned button,
int far *x, int far *y);
Purpose: Return the number of times the specified
button has been released since the last call
to this function (with the same button
parameter), and store the coordinates of the
last press.
Parameters: The button 'button' is checked, and may be
any of LEFTBUTTON, RIGHTBUTTON, and
CENTERBUTTON, which are defined in
TGEMOUSE.H. The position of the last release
will be stored in ('x','y').
Return value: Returns the number of times the specified
button has been released since the last call
to this function (with the same button
parameter).
Remarks: None.
See also: buttonPressMouse()
*** Function: setHorizLimitsMouse()
Syntax: void setHorizLimitsMouse(unsigned min,
unsigned max);
Purpose: Set the minimum and maximum horizontal
coordinates for the pointer.
Parameters: The minimum horizontal coordinate will be set
to 'min', and the maximum to 'max'.
Return value: None.
Remarks: None.
See also: setVertLimitsMouse()
*** Function: setVertLimitsMouse()
Syntax: void setVertLimitsMouse(unsigned min,
unsigned max);
Purpose: Set the minimum and maximum vertical
coordinates for the pointer.
Parameters: The minimum vertical coordinate will be set
to 'min', and the maximum to 'max'.
Return value: None.
Remarks: None.
See also: setHorizLimitsMouse()
*** Function: setPointerMouse()
Syntax: void setPointerMouse(int xOff, int yOff, void
far *p);
Purpose: Set the shape of the pointer.
Parameters: The image pointed to by 'p' will be the
pointer bitmap. ('xOff','yOff') is the
offset, relative to the upper-left corner of
the bitmap, of the "hot spot" -- the pixel
where the pointer is actually registered as
being. (For instance, the standard arrow
pointer has its hot spot in the upper-left,
while a crosshairs pointer would have it
towards the middle.)
Return value: None.
Remarks: None.
See also: None.
*** Function: getSaveSizeMouse()
Syntax: unsigned getSaveSizeMouse(void);
Purpose: Return the size of the buffer necessary to
store the state of the mouse driver.
Parameters: None.
Return value: Returns the size of the buffer.
Remarks: If a program using TGE and the new mouse
handling routines is to run another program,
for instance shelling to DOS, the ensuing
procedure should be followed: call
disableNewMouse(), call getSaveSizeMouse(),
allocate a block of memory with the size
returned by getSaveSizeMouse(), call
saveStateMouse(), run the program, call
restoreStateMouse(), free the block of
memory, then call enableNewMouse().
See also: saveStateMouse(), restoreStateMouse()
*** Function: saveStateMouse()
Syntax: void saveStateMouse(void far *buf);
Purpose: Save the current state of the mouse driver.
Parameters: The block of memory pointed to by 'buf' will
be used to store the state data. Its length
should be obtained by calling
getSaveSizeMouse().
Return value: None.
Remarks: If a program using TGE and the new mouse
handling routines is to run another program,
for instance shelling to DOS, the ensuing
procedure should be followed: call
disableNewMouse(), call getSaveSizeMouse(),
allocate a block of memory with the size
returned by getSaveSizeMouse(), call
saveStateMouse(), run the program, call
restoreStateMouse(), free the block of
memory, then call enableNewMouse().
See also: getSaveSizeMouse(), restoreStateMouse()
*** Function: restoreStateMouse()
Syntax: void restoreStateMouse(void far *buf);
Purpose: Restore the state of the mouse driver from a
buffer previously filled by saveStateMouse().
Parameters: The block of memory pointed to by 'buf'
stores the state data.
Return value: None.
Remarks: If a program using TGE and the new mouse
handling routines is to run another program,
for instance shelling to DOS, the ensuing
procedure should be followed: call
disableNewMouse(), call getSaveSizeMouse(),
allocate a block of memory with the size
returned by getSaveSizeMouse(), call
saveStateMouse(), run the program, call
restoreStateMouse(), free the block of
memory, then call enableNewMouse().
See also: getSaveSizeMouse, saveStateMouse
*** Function: setRatioMouse()
Syntax: void setRatioMouse(unsigned horiz, unsigned
vert);
Purpose: Set the mouse sensitivity, in units of
mickeys per 8 pixels of pointer movement. (A
mickey is the unit used to measure mouse
movement.)
Parameters: The horizontal mickeys to pixels ratio will
be set to 'horiz', and the vertical to
'vert'.
Return value: None.
Remarks: None.
See also: getSensitivityMouse()
*** Function: getSensitivityMouse()
Syntax: void getSensitivityMouse(unsigned *horiz,
unsigned *vert, unsigned *doubleSpeed);
Purpose: Get the mouse sensitivity, in units of
mickeys per 8 pixels of pointer movement. (A
mickey is the unit used to measure mouse
movement.) The mouse double speed threshold
(the minimum number of mickeys per second of
motion before pointer movement is doubled) is
retrieved as well.
Parameters: The horizontal mickeys to pixels ratio will
be stored in 'horiz', the vertical in 'vert',
and the double speed threshold in
'doubleSpeed'.
Return value: None.
Remarks: None.
See also: setRatioMouse()
*** Function: softResetMouse()
Syntax: void softResetMouse(void);
Purpose: Reset the mouse driver, but not the hardware.
Parameters: None.
Return value: None.
Remarks: This function is equivalent to resetMouse(),
except in that it performs no initialization
of the mouse hardware.
See also: resetMouse()
*** Function: waitReleaseMouse()
Syntax: void waitReleaseMouse(int button);
Purpose: If the specified button is not already up,
wait until it is released, then return.
Parameters: The button 'button' is checked, and may be
any of LEFTBUTTON, RIGHTBUTTON, and
CENTERBUTTON, which are defined in
TGEMOUSE.H.
Return value: None.
Remarks: None.
See also: buttonMouse(), leftButtonMouse(),
rightButtonMouse(), centerButtonMouse()
Note that since these function names are actually macros,
they may easily be changed to suit individual preferences by
editing TGEMOUSE.H.
WRITING GRAPHICS DRIVERS
────────────────────────
To build a new graphics driver, follow these steps:
1. Copy the file SHELL.ASM to another file, for example,
MYDRV.ASM.
2. Change the maximum X-coordinate, Y-coordinate, and
colour number to the appropriate values. (They are clearly
identified with comments.) Also change the aspect ratio
values to the correct values. For example, in 800x600
resolution, the x:y ratio is 800:600, which simplifies to
4:3 in lowest terms when both sides are divided by 200. In
this case, the first of the two numbers in the driver will
be 4, and the second will be 3.
3. A graphics driver must always contain the initGraphics()
routine. Replace the default one from SHELL.ASM with
whatever the appropriate code is. (Be sure to add return
value logic, described in the initGraphics() description
above.)
4. If the new video mode is not supported by the video
BIOS, custom putPixel() and getPixel() routines must be
written and placed in the driver. Doing so is advised
anyway, as the BIOS is notoriously slow.
5. The default palette management routines assume that the
video mode's palette registers have a resolution of six
bits. The standard VGA has only 6-bit resolution, but some
SuperVGAs support 8-bit resolution. If the video mode for
which the driver is being written supports a true 8-bit
palette, the four palette management routines should be
written and placed in the driver.
6. Several routines assume that each pixel has a size of
exactly one byte, as 256-colour modes are so common.
(Namely, these routines are putImage(), getImage(),
putLine(), getLine(), imageSize(), putPixel(), and
getPixel().) If the new video mode does not have one-byte
pixels, these routines should be written and placed in the
driver.
7. If the new video mode is not a 256-colour mode, the
colourCloseTo() and colourCloseToX() functions should be
written and placed in the driver.
8. If speed is important, write any routines that have not
already been written.
9. For every routine that has been written, a change must
be made in the header of the driver's source code so that
loadGraphDriver() recognize it. As an example, assume that
horizLine has been written. Find the "; horizLine" comment
near the top of the source file. Change the "0" to the left
of it to the exact name of the new horizLine() routine.
Repeat this procedure if necessary, until the change has
been made for every routine contained in the driver.
10. A usable driver must be created from the source code.
This process involves three steps. First, assemble the .ASM
source file to an .OBJ object file. Then, link the .OBJ so
it becomes an .EXE file. Third, run EXE2BIN, which comes
with DOS. Assuming the driver's source code was called
MYDRV, EXE2BIN's command line would be "EXE2BIN MYDRV.EXE
MYDRV.DRV". When this last step is completed, there will be
a newly created driver, ready to be loaded and used with
TGE. The file CDRV.BAT is included to automate this chore;
it assumes the use of TASM and TLINK. Note that since 16-
bit offsets are used, the final driver may not be larger
than 64 Kb (not a likely problem).
TERMS OF USAGE AND DISTRIBUTION
───────────────────────────────
The Graphics Engine source code and associated documentation
are copyright (c) 1993 by Matthew Hildebrand.
The Graphics Engine, consisting of the files listed in the
PACKING LIST section, may be distributed freely, so long as:
1. The distributed package is complete, and its
contents are not modified in any way.
2. The distributed package is not sold for profit.
The Graphics Engine is not free; no part of it may be used
in any program without first purchasing it. After an
individual or organization ("the Purchaser") has purchased a
copy of The Graphics Engine, the Purchaser is granted
permission to:
1. Use any or all of The Graphics Engine in as many
software packages as the Purchaser likes.
2. Distribute any software packages built using The
Graphics Engine without royalties.
3. Modify any of the program code, and use the
modified code as described in 1 and 2 above.
Note that the Purchaser is granted permission to use any
version of The Graphics Engine, including any new ones when
they are released; ie., upgrades are free.
The privileges granted to the Purchaser by purchasing The
Graphics Engine may be retracted if any of the following
conditions is broken:
1. The copyright notice, which reads "The Graphics
Engine 1.20 -- Copyright (c) 1993 by Matthew
Hildebrand" must be included in the executable
portion of any software package built using it, as
well as in any driver files (designed to work with
The Graphics Engine) which are part of that
software package. The file TGE.C, as it is
shipped, contains this notice, as do the sources
for the drivers.
2. Any program code derived or directly obtained from
The Graphics Engine may not be distributed in any
way, unless the recipient has also purchased a
copy of The Graphics Engine.
3. Permission is granted to use The Graphics Engine
to create executable software applications; The
Graphics Engine may not be used in the creation of
another graphics library, unless prior written
consent is obtained from the author of The
Graphics Engine.
In order to purchase a copy of The Graphics Engine, send $25
(US or Canadian funds) to Matthew Hildebrand at the address
listed in CONTACTING THE AUTHOR below. Payment by money
order, check, or cash is acceptable. The file REGISTER.FRM
is provided for both your convenience and mine; it is
designed to be printed out and filled in. Thank you in
advance.
CONTACTING THE AUTHOR
─────────────────────
I would appreciate hearing any questions, comments, bug
reports, or suggestions for improvement. If you have any,
feel free to contact me. I can be reached at either of the
following addresses. Contributions of any kind to help
improve this project are welcome. When reporting bugs,
please be sure to mention the version of TGE to which you
are referring.
Snail mail:
Matthew Hildebrand
4 College St.
St. Catharines, ON
Canada
L2R 2W7
Fidonet mail:
1:247/128.2
Internet mail: (no guarantees on this one!)
Matthew.Hildebrand@p2.f128.n247.z1.fidonet.org
OBTAINING THE GRAPHICS ENGINE
─────────────────────────────
The most recent copy of TGE may be obtained via file request
from 1:247/128 (14400 bps V.32bis) using the magic file name
"TGE"; unlisted nodes and points are welcome.
TGE is also available via first-call download from 1:247/128
at (416)-935-6628. (After October, 1993, the area code will
change to 905.)
REVISION HISTORY
────────────────
1.20 Added support for loadable fonts, viewports,
colour approximation, and region fills.
Rewrote the loadGraphDriver() function; it now
returns more descriptive values.
Added various clipping routines: clipLine() and
clipFilledRect() in CLIP.C, and clipPoint() and
pointOnScreen() as macros in TGE.H.
Fixed aspect ratio problem in 360x480 driver.
Fixed bug in 800x600 driver when run with the
Trident 8900 chipset.
Added the REGISTER.FRM file.
1.10 Improved and debugged SuperVGA support. Bugs
squashed include the infamous Trident and Oak
bugs.
Added drivers for VGA 360x480 and SuperVGA
1024x768.
Added interrupt-driven definable mouse pointer
services, as well as miscellaneous mouse routines.
Fixed default palette routines to do translation
between 6-bit and 8-bit values.
Added ellipse(), filledEllipse(), circle(), and
filledCircle().
Added PCX2RAW, a utility to convert 256-colour PCX
files into raw bitmap and raw palette files. This
utility makes importing graphics easy.
1.01 First public release.
ACKNOWLEDGEMENT
───────────────
There are many people whom I would like to thank for their
suggestions, beta-testing, patience, and help with
distribution. You know who you are.
LEGAL MUMBO JUMBO
─────────────────
All software and documentation associated with The Graphics
Engine is provided "as is", and without warranty of any
kind. The author may not be held liable for any damage or
misfortune that the usage of this software may cause.
Although the software has undergone extensive testing, there
is a chance that it may crash anyway. It is not even
guaranteed to do anything.
All registered trademarks in this document belong to
whomever it is that owns them.